package com.tom.blog.dao;

import java.util.Collection;
import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import com.tom.blog.entity.User;
/**
 * @author tomZ
 *
 */
@Repository
public interface UserDao extends JpaRepository<User, Long>{
	/**
	 * @param name
	 * @param pageable
	 * @return
	 */
	Page<User> findByNameLike(String name, Pageable pageable);
	
	/**
	 * @param username
	 * @return
	 */
	User findByUsername(String username);

	List<User> findByUsernameIn(Collection<String> usernames);
}
